package com.example.yjhteam.controller;


import com.example.common.vo.Result;
import com.example.yjhteam.mapper.PlayersMapper;
import com.example.yjhteam.service.IPlayersService;
import com.yc.yjh.entity.Players;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 选手表 前端控制器
 * </p>
 *
 * @author ly
 * @since 2023-07-24
 */
@RestController
@RequestMapping("/yjh/players")
public class PlayersController {


    @Resource
    IPlayersService iPlayersService;

    @Resource
    PlayersMapper playersMapper;

    @RequestMapping("players")
    public List<Players> queryplayers(@RequestParam("team_id") int teamId){
        return iPlayersService.selectPlayerByTid(teamId);
    }
    @RequestMapping("player")
    public Result queryplayer(@RequestParam("player_id") int playerId){
        return  Result.success("查询成功",playersMapper.findOnePlayer(playerId));
    }
}
